package com.esdc.librarysystem.datastate;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author shou1dwe
 */
public class BookState implements Serializable{
    private Long id;
    private String title;
    private Date loanDate;
    private Date dueDate;

    public BookState(Long id, String title, Date loanDate, Date dueDate) {
        this.id = id;
        this.title = title;
        this.loanDate = loanDate;
        this.dueDate = dueDate;

    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @return the loanDate
     */
    public Date getLoanDate() {
        return loanDate;
    }

    /**
     * @param loanDate the loanDate to set
     */
    public void setLoanDate(Date loanDate) {
        this.loanDate = loanDate;
    }

    /**
     * @return the dueDate
     */
    public Date getDueDate() {
        return dueDate;
    }

    /**
     * @param dueDate the dueDate to set
     */
    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    @Override
    public String toString(){
        return String.format("Book (ID: %d)%s Start: %s Due: %s", id, title, loanDate, dueDate);
    }
}
